﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace FileExplorerService
{
    using System.IO;

    // HINWEIS: Mit dem Befehl "Umbenennen" im Menü "Umgestalten" können Sie den Schnittstellennamen "IService1" sowohl im Code als auch in der Konfigurationsdatei ändern.
    [ServiceContract]
    public interface IFileExchangeService
    {
        [OperationContract]
        Guid Start(string path, bool read);

        [OperationContract]
        Guid StartEnumeration(string path);

        [OperationContract]
        void SendData(Guid handle, byte[] bytes, int offset, int count);

        [OperationContract]
        byte[] ReadData(Guid handle, int maxBuffersize);

        [OperationContract]
        FileElements GetNext(Guid handle);

        [OperationContract]
        void End(Guid handle);


    }
    [DataContract]
    public class FileElements
    {
        [DataMember]
        public bool IsMore { get; set; }

        [DataMember]
        public List<FileElement> Content { get; set; }
    }

    [DataContract]
    public class FileElement
    {
        [DataMember]
        public bool IsFile { get;  set; }

        [DataMember]
        public string Name { get;  set; }
    }
}
